/*
 * @Author: your name
 * @Date: 2022-03-16 20:32:37
 * @LastEditTime: 2022-04-18 03:22:41
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \react-antd-admin\vue-admin-template\src\api\role.js
 */
import request from '@/utils/request'
// 获取所有角色
export function getFindRole() {
  return request({
    url: '/role/findAllRoles',
    method: 'get'
  })
}
// 根据当前用户角色id查询菜单
export function getFindMenus(id) {
  return request({
    url: '/user/findMenus',
    method: 'get',
    params: { id }
  })
}

// 添加角色
export function createRole(data) {
  return request({
    url: '/role/createRole',
    method: 'post',
    data
  })
}

// 删除角色
export function deleteRoleById(data) {
  return request({
    url: '/role/deleteRoleById',
    method: 'delete',
    data
  })
}

// 修改角色
export function updateRole(data) {
  return request({
    url: '/role/updateRoleById',
    method: 'post',
    data
  })
}
// 授权
export function authorizationById(data) {
  return request({
    url: '/role/authorizationById',
    method: 'post',
    data
  })
}
export function findRoleById(data) {
  return request({
    url: '/role/findRoleById',
    method: 'post',
    data
  })
}